/* 
 * File:   Button.h
 * Author: lgr013
 *
 * Created on 11 de octubre de 2014, 16:55
 */

#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include "SBSImage.h"
#include "Window.h"
#include <stdio.h>
#include <string>

#ifndef BUTTON_H
#define	BUTTON_H

//CONSTANTES de los botones para cortar del sprite
const int BUTTON_WIDTH = 201;
const int BUTTON_HEIGHT = 70;
const int TOTAL_BUTTONS = 3;

enum myButtonSprite {
    BUTTON_SPRITE_MOUSE_OUT = 0,
    BUTTON_SPRITE_MOUSE_OVER_MOTION = 1,
    BUTTON_SPRITE_MOUSE_DOWN = 2,
    BUTTON_SPRITE_TOTAL = 3
};


//The mouse button

class Button {
private:
    //Top left position
    SDL_Point mPosition;

    //Currently used global sprite
    myButtonSprite mCurrentSprite;

public:
    //Initializes internal variables
    Button();

    //Sets top left position
    void setPosition(int x, int y);

    //Handles mouse event
    bool handleEvent(SDL_Event* e);

    bool loadSprite(int swidth, int sheight, SDL_Renderer** gRenderer);

    //Shows button sprite
    void render(SDL_Renderer** gRenderer);



};

#endif	/* BUTTON_H */

